package com.zcr.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zcr.mapper.JinhuorecordsMapper;
import com.zcr.pojo.Jinhuorecords;
import com.zcr.service.JinhuorecordsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @author： 张诚
 * @date： 2021-03-09 09:10
 */
@Service("JinhuorecordsService")
public class JinhuorecordsServiceImpl extends ServiceImpl<JinhuorecordsMapper, Jinhuorecords> implements JinhuorecordsService {

    @Resource
    private JinhuorecordsMapper jinhuorecordsMapper;

    public Page<Jinhuorecords> getbyjinhuoxinxi(String drugname, int pageNo, int pageSize) {
        QueryWrapper<Jinhuorecords> wrapper=Wrappers.query();
        wrapper.like(!StringUtils.isBlank(drugname),"drugname",drugname);
        Page<Jinhuorecords> page = new Page<>(pageNo,pageSize);
        return jinhuorecordsMapper.selectPage(page,wrapper);
    }

}
